<template>
	<div id="r_page">
		<div id="timer">
		 <label>{{time | filterTime}}</label>
		</div>
		<div id="news">
			<div>新闻十条</div>
			<ul>
				<li v-for="item in newsList">
          <a :href="item.url">{{item.title}}</a>  
        </li>
			</ul>	
		</div>
		<div id="betters">
			<div>推荐</div>
			<ul>
				<li v-for="item in acticleList" @click="turnAction(item.id)">
					<label>{{item.title}}</label>
				</li>
			</ul>
		</div>
		<div id="weixin">
			<div>关注公众号</div>
			<img src="../../static/img/qrcode.jpg">
			<div class="mssage">关注公众号查看更多精彩内容</div>
		</div>
	</div>
</template>
<script >
	export default {
        data: function() {
            return {
                time:Date.parse(new Date()),
                newsList:[],
                acticleList:[]
            }
        },
        computed:{
           
        },
        methods:{
          turnAction(id){
            this.router.push("/details/"+id);
          },
            getArcitleList:function(){
             var _self=this;
             this.api.getNews().then(res => {   
                console.log(res);
                _self.newsList=res.data.data;
                
           
            }).catch(function(error) {
                console.log(error);
            });
           },
           getRecommended:function(){
             var _self=this;
             this.api.getRecommended().then(res => {   
                console.log(res);
                _self.acticleList=res.data.data;
                
           
            }).catch(function(error) {
                console.log(error);
            });
           }
           
        },
        components:{
            
        },
       
        created() {
            this.getArcitleList();
            this.getRecommended();
           
        },
         mounted: function() {
            

        },
       

    }



</script>

<style lang="scss"  scoped>
@import "../../static/css/recommend.scss";

</style>